// 
//  Programme.m
//  Prospectus
//
//  Created by Ken Power on 16/01/2011.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "Programme.h"

#import "Department.h"
#import "Person.h"
#import "DataAccess.h"

@implementation Programme 

@synthesize SubjectsYear4;
@synthesize NumPlaces;
@synthesize Title;
@synthesize TextSpecialFeatures;
@synthesize PointsCutOff;
@synthesize SubjectsYear3;
@synthesize TextMinimumEntryRequirements;
@synthesize AwardType;
@synthesize SubjectsYear2;
@synthesize StartYear;
@synthesize TextWhatCourseIsAbout;
@synthesize NFQLevel;
@synthesize TextAbleToDo;
@synthesize SubjectsYear1;
@synthesize PointsAvg;
@synthesize PointsMax;
@synthesize NumYears;
@synthesize CAOCode;
@synthesize TextExemptionsAvailable;
@synthesize TextFollowOnOppertunities;


- (void) initWithSQL:(sqlite3_stmt*)sql{
	
	// SCHEMA
	//	Z_PK INTEGER PRIMARY KEY, 0
	//	Z_ENT INTEGER, 1
	//	Z_OPT INTEGER, 2
	
	//	ZNUMPLACES INTEGER, 3 
	NumPlaces=sqlite3_column_int(sql, 3);
	//	ZPOINTSCUTOFF INTEGER, 4
	PointsCutOff=sqlite3_column_int(sql, 4);
	//	ZSTARTYEAR INTEGER,  5
	StartYear=sqlite3_column_int(sql, 5);
	//	ZNFQLEVEL INTEGER, 6
	NFQLevel=sqlite3_column_int(sql, 6);
	//	ZPOINTSAVG INTEGER, 7
	PointsAvg=sqlite3_column_int(sql, 7);
	//	ZDURATION INTEGER, 8
	NumYears=sqlite3_column_int(sql, 8);
	//	ZPOINTSMAX INTEGER, 9
	PointsMax=sqlite3_column_int(sql, 9);
	//	ZCONTACTPERSON INTEGER,10 
	//	ZDEPARTMENT INTEGER,  11
	//	ZSUBJECTSYEAR4 VARCHAR, 12
	//sqlString=(char*)sqlite3_column_text(sql, 12);
	self.SubjectsYear4=[DataAccess getStringFrom:sql InCol:12];
	//  ZTITLE VARCHAR, 13
	//sqlString= (char *)sqlite3_column_text(sql, 13);
	self.Title =[DataAccess getStringFrom:sql InCol:13];
	
	//	ZTEXTSPECIALFEATURES VARCHAR, 14
	//sqlString= (char *)sqlite3_column_text(sql, 14);
	self.TextSpecialFeatures = [DataAccess getStringFrom:sql InCol:14];

	//	ZSUBJECTSYEAR3 VARCHAR, 15
	//sqlString= (char *)sqlite3_column_text(sql, 15);
	self.SubjectsYear3 = [DataAccess getStringFrom:sql InCol:15];

	//	ZTEXTMINIMUMENTRYREQUIREMENTS VARCHAR, 16
	//sqlString= (char *)sqlite3_column_text(sql, 16);
	self.TextMinimumEntryRequirements = [DataAccess getStringFrom:sql InCol:16];

	
	//	ZAWARDTYPE VARCHAR, 17
	//sqlString= (char *)sqlite3_column_text(sql, 17);
	self.AwardType = [DataAccess getStringFrom:sql InCol:17];

	//	ZSUBJECTSYEAR2 VARCHAR, 18
	//sqlString= (char *)sqlite3_column_text(sql, 18);
	self.SubjectsYear2 = [DataAccess getStringFrom:sql InCol:18];	
	
	//	ZTEXTABLETODO VARCHAR, 19
	//sqlString= (char *)sqlite3_column_text(sql, 19);
	self.TextAbleToDo = [DataAccess getStringFrom:sql InCol:19];

	//	ZSUBJECTSYEAR1 VARCHAR, 20
	//sqlString= (char *)sqlite3_column_text(sql, 20);
	self.SubjectsYear1 = [DataAccess getStringFrom:sql InCol:20];

	//	ZTEXTWHATCOURSEISABOUT VARCHAR, 21
	//sqlString= (char *)sqlite3_column_text(sql, 21);
	self.TextWhatCourseIsAbout = [DataAccess getStringFrom:sql InCol:21];
	
	//	ZCAOCODE VARCHAR, 22
	//sqlString= (char *)sqlite3_column_text(sql, 22);
	self.CAOCode = [DataAccess getStringFrom:sql InCol:22];

	//ZTEXTEXEMPTIONSAVAILABLE VARCHAR, 23
	//sqlString= (char *)sqlite3_column_text(sql, 23);
	self.TextExemptionsAvailable =[DataAccess getStringFrom:sql InCol:23];

	//ZTEXTFOLLOWONOPPERTUNITIES VARCHAR, 24
	//sqlString= (char *)sqlite3_column_text(sql, 24);
	self.TextFollowOnOppertunities = [DataAccess getStringFrom:sql InCol:24];

	

}

- (void)dealloc {
	[TextFollowOnOppertunities release];
	[TextExemptionsAvailable release];
	[CAOCode release];
	[TextWhatCourseIsAbout release];
	[SubjectsYear1 release];
	[TextAbleToDo release];
	[AwardType release];
	[TextMinimumEntryRequirements release];
	[SubjectsYear3 release];
	[TextSpecialFeatures release];
	[Title release];
	[SubjectsYear4 release];
	
	[super dealloc];
}

@end
